package com.peace.hospital.feign.drugstorage.controller;

import com.peace.hospital.entity.drugstorage.dto.ModpriceDto;


import com.peace.hospital.feign.drugstorage.service.IDrugStorageService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 调价表 前端控制器
 * </p>
 *
 * @author xie
 * @since 2019-11-23
 */
@RestController
@RequestMapping("/modprices")
public class ModpriceController {
    @Autowired
    private IDrugStorageService iModpriceService;

    //添加调价信息
    @RequiresRoles(value = {"root","drugstorage"},logical = Logical.OR)
    @RequestMapping(value = "/insert", method = {RequestMethod.POST})
    public String addModprice(ModpriceDto modpriceDto){
        System.out.println(modpriceDto);
    return  iModpriceService.InsertModprice(modpriceDto);

    }


  //查询调价信息
  @RequiresRoles(value = {"root","drugstorage"},logical = Logical.OR)
  @RequestMapping(value = "/select", method = {RequestMethod.GET})
  public  String selectModprice( Integer  drugid) {
      return iModpriceService.selectModprice(drugid);
    }
  }
